package com.leonardo.beanme.fields.impl;

import javax.microedition.lcdui.ChoiceGroup;

import com.leonardo.beanme.fields.abs.ChoiceBox;
import com.leonardo.beanme.model.RadioBox;

public class RadioInput extends ChoiceBox {
	
	public RadioInput() {
		super(ChoiceGroup.EXCLUSIVE);
	}

	public void setValue(Object obj) {
		if(lock)	return;
		if(!(obj instanceof RadioBox))
			throw new IllegalArgumentException();
		RadioBox radioBox = (RadioBox) obj;
		getGroup().setSelectedIndex(radioBox.getSelectedIndex(), true);
	}
	
}
